#include "peekpoke.h"
#include "Twist.h"

char twistCharPtoA(char source)
{
	static char result;
	__asm__("LDA $EA");
	__asm__("PHA");
	POKE(0xEA, source);
	twistCharMLPtoA();
	result = PEEK(0xEA);
	__asm__("PLA");
	__asm__("STA $EA");
	return result;
}

char twistCharAtoP(char source)
{
	static char result;
	__asm__("LDA $EA");
	__asm__("PHA");
	POKE(0xEA, source);
	twistCharMLAtoP();
	result = PEEK(0xEA);
	__asm__("PLA");
	__asm__("STA $EA");
	return result;
}